//
//  MyWalletViewController.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/24.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "MyWalletViewController.h"
#import "MingXiViewController.h"
@interface MyWalletViewController ()
@property (nonatomic,strong)UIView *walletView;//钱包View
@property (nonatomic,strong)UILabel *moneyLab;//余额
@property (nonatomic,strong)CanLab *chongZhiBtn;//充值按钮
@end

@implementation MyWalletViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initTitleWithTitle:@"我的钱包"];
    [self initLeftBarButtonWithImage:@"back"];
    self.view.backgroundColor = backColor;
    [self.view addSubview:self.walletView];
    [self.view addSubview:self.chongZhiBtn];
}

//钱包View
-(UIView *)walletView
{
    if (!_walletView) {
        
        _walletView = [[UIView alloc]initWithFrame:CGRectMake(0, 10*screenW_6, SCREENW, 82*screenW_6)];
        _walletView.backgroundColor = [UIColor whiteColor];
        
        //灰色我的余额
        UILabel *grayLab = [TomamaUI createLabel:CGRectMake(15*screenW_6, 10*screenW_6,150*screenW_6, 25*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:13*screenW_6] textColor:TextGray text:@"我的余额:"];
        [_walletView addSubview:grayLab];
        
        //余额
        _moneyLab = [TomamaUI createLabel:CGRectMake(15*screenW_6,CGRectGetMaxY(grayLab.frame)+3*screenW_6, SCREENW/2, 30*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:24*screenW_6] textColor:[UIColor colorWithHexString:@"#2cb4F1"] text:@"¥0.00"];
        [_walletView addSubview:_moneyLab];
        
        //我的明细
        CanLab *MingXiLab = [[CanLab alloc]initWithFrame:CGRectMake(SCREENW-100*screenW_6, 28*screenW_6, 70*screenW_6, 28*screenW_6) textAligment:1 font:12*screenW_6 textColor:@"#26b5a4" text:@"我的明细"];
        MingXiLab.layer.borderWidth = 1;
        MingXiLab.layer.borderColor = [[UIColor colorWithHexString:@"#26b5a4"] CGColor];
        [MingXiLab.layer setCornerRadius:14*screenW_6];
        MingXiLab.layer.masksToBounds = YES;
        [_walletView addSubview:MingXiLab];
        MingXiLab.block = ^(CanLab *lab)//我的明细点击事件
        {
            [self.navigationController pushViewController:[MingXiViewController new] animated:YES];
        };
        
    }
    return _walletView;
}

//充值按钮
-(CanLab *)chongZhiBtn
{
    if (!_chongZhiBtn) {
        _chongZhiBtn = [[CanLab alloc]initWithFrame:CGRectMake(10*screenW_6,CGRectGetMaxY(_walletView.frame)+15*screenW_6,SCREENW-20*screenW_6 , 44*screenW_6) textAligment:1 font:16*screenW_6 textColor:@"#ffffff" text:@"充值"];
        _chongZhiBtn.backgroundColor = [UIColor colorWithHexString:@"#2cb4f1"];
        [_chongZhiBtn.layer setCornerRadius:5*screenW_6];
        _chongZhiBtn.layer.masksToBounds = YES;
        _chongZhiBtn.block = ^(CanLab *lab)//我的明细点击事件
        {
            
        };
    }
    return _chongZhiBtn;
}

@end
